package com.zl.controller;

import com.zl.entity.po.Stu;
import com.zl.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhanglei2
 * @since 2019/12/11 11:49
 */
@Controller
public class StuController {
    @Autowired
    private StuService stuService;
    @RequestMapping("/list1")
    public String getStu(Model model){
        List<Stu> list = stuService.getStuList();
        System.out.println(list);
        model.addAttribute("list",list);
        return "index";
    }
    // @RequestMapping("/edit/${id}")
    // public void edit(@PathVariable Integer id ){
    //     System.out.println("=================   "+id+"  =====================");
    // }
}
